import request from '@/utils/http'
//登录
export function login(data) {
    return request({
        url: 'admin/login',
        method: 'post',
        data
    })
}
//根据token查询用户信息
export function usermsg(params) {
    return request({
        url: 'admin/usermsg',
        method: 'get',
        params
    })
}
//用户列表
export function userlist(params) {
    return request({
        url: 'admin/userlist',
        method: 'get',
        params
    })
}
//添加用户
export function adduser(data){
    return request({
        url:"admin/register",
        method: 'post',
        data
    })
}
//更新用户
export function updateuser(id,data){
    return request({
        url: `admin/updateuser/${id}`,
        method: 'post',
        data
    })
}
//删除用户
export function deluser(id) {
    return request({
        url: `admin/deluser/${id}`,
        method: 'post',
    })
}
//获取权限选择菜单
export function roleselect(){
    return request({
        url: 'role/roleselect',
        method: 'get'
    })
}
//添加权限
export function addrole(data) {
    return request({
        url: 'role/addRole',
        method: 'post',
        data
    })
}
//权限列表
export function rolelist(params) {
    return request({
        url: 'role/roleList',
        method: 'get',
        params
    })
}
//编辑权限
export function updaterole(id,data){
    return request({
        url: `role/updateRole/${id}`,
        method: 'post',
        data
    })
}
//删除权限
export function delrole(id) {
    return request({
        url: `role/delRole/${id}`,
        method: 'post',
    })
}
//查询权限所含路由
export function roleRouter(role) {
    return request({
        url: `role/roleRouter/${role}`,
        method: 'post',
    })
}
